package city.spring.modules.work.vo;

import city.spring.modules.work.entity.WorkScheduleEntity;
import city.spring.modules.work.entity.WorkScheduleItemEntity;
import city.spring.modules.work.entity.WorkScheduleShiftEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.util.List;
import java.util.Map;

/**
 * @author HouKunLin
 * @date 2020/6/4 0004 16:56
 * @see WorkScheduleEntity
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class WorkScheduleVO extends WorkScheduleEntity {
    /**
     * 排班结果列表（人员上班具体信息项）
     */
    private List<? extends WorkScheduleItemEntity> items;
    /**
     * 排班结果列表（上班班次列表）
     */
    private Map<String, ? extends WorkScheduleShiftEntity> shifts;

    public WorkScheduleVO(WorkScheduleEntity entity) {
        super.setId(entity.getId());
        super.setWorkPlanId(entity.getWorkPlanId());
        super.setTitle(entity.getTitle());
        super.setStartDate(entity.getStartDate());
        super.setEndDate(entity.getEndDate());
        super.setIsEnabled(entity.getIsEnabled());
        super.setVersion(entity.getVersion());
        super.setGmtCreated(entity.getGmtCreated());
        super.setGmtModified(entity.getGmtModified());
    }

    @Override
    public String toString() {
        return super.toString();
    }
}
